package com.rem.designPattern.Composite组合;

/**
 * @author Rem
 * @date 2022-11-17
 */
public class Client {
    public static void main(String[] args) {
        //大学
        Organization university = new University("清华大学");
        //学院
        Organization computerCollege = new College("计算机学院");
        //专业
        computerCollege.add(new Subject("软件工程"));
        computerCollege.add(new Subject("网络工程"));
        computerCollege.add(new Subject("计算机科学与技术"));
        university.add(computerCollege);

        Organization infoEngineerCollege = new College("信息工程学院");
        //专业
        infoEngineerCollege.add(new Subject("通信工程"));
        infoEngineerCollege.add(new Subject("信息工程"));
        university.add(infoEngineerCollege);

        university.print();
    }
}